package ooday02;

/**
 * Animal类:动物类
 */
public class Animal {
    String name;
    int age;
    String color;
    Animal() {
    }
    Animal(String name, int age, String color) {
        this.name = name;
        this.age = age;
        this.color = color;
    }
    void eat() {
        System.out.println(color+"色的"+age+"岁的"+name + "正在吃饭...");
    }
    void drink() {
        System.out.println(color+"色的"+age+"岁的"+name + "正在喝水...");
    }
}

/**
 * Dog类
 */
class Dog extends Animal {
    Dog() {
    }
    Dog(String name, int age, String color) {
       super(name,age,color);
    }
    void eat() {
        System.out.println(color+"色的"+age+"岁的狗狗"+name + "正在吃骨头...");
    }
    void lookHome() {
        System.out.println(color+"色的"+age+"岁的狗狗"+name + "看家...");
    }
}

/**
 * Chick类
 */
class Chick extends Animal {
    Chick() {
    }
    Chick(String name, int age, String color) {
        super(name,age,color);
    }
    void eat() {
        System.out.println(color+"色的"+age+"岁的小鸡"+name + "正在吃小米");
    }
    void layEggs() {
        System.out.println(color+"色的"+age+"岁的小鸡"+name + "正在下蛋...");
    }
}

/**
 * Fish类
 */
class Fish extends Animal {
    Fish() {
    }
    Fish(String name, int age, String color) {
        super(name,age,color);
    }
    void eat() {
        System.out.println(color+"色的"+age+"岁的小鱼"+name + "正在吃小虾...");
    }
}